package api
import (

)
import (
	"git.oschina.net/zhgk/sqldb"
	"git.oschina.net/zhgk/config"
)

func TestInitDb(){
	initDB("debug")
}

//初始化数据库
func initDB(mode string) error {
	jdbcUrl, maxOpen, maxIdle, maxLife, err := config.ReadJdbcConfig("D:/CODE/OSC/GO/src/app/conf/jdbc.ini", mode)
	if err != nil {
		return err
	}
	err = sqldb.AddDB("default", "mysql", jdbcUrl, maxOpen, maxIdle, maxLife)
	if err != nil {
		return err
	}
	return nil
}